home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEX-UTIL / DVIPS_55 / dvips / src / c / dospecial < prev    next >
Text File  |  1994-05-06  |  18KB  |  652 lines

  1. /*
  2.  *   This routine handles special commands;
  3.  *   predospecial() is for the prescan, dospecial() for the real thing.
  4.  */
  5. #include "dvips.h" /* The copyright notice in that file is included too! */
  6.  
  7. /* extern int atoi(); */
  8. extern void fil2ps();
  9. extern FILE *search();
  10. extern int system();
  11. /*
  12.  *   These are the external routines called:
  13.  */
  14. /**/
  15. #ifdef TPIC
  16. /*
  17.  * Fri Mar  9 1990  jourdan@minos.inria.fr (MJ)
  18.  * Upgraded to accommodate tpic release 2.0 extended output language.
  19.  * Should prove upward compatible!
  20.  */
  21. extern void setPenSize();
  22. extern void flushPath();
  23. extern void flushDashed();
  24. extern void flushDashed();
  25. extern void addPath();
  26. extern void arc();
  27. extern void flushSpline();
  28. extern void shadeLast();
  29. extern void whitenLast();
  30. extern void blackenLast();
  31. extern void SetShade() ;
  32. #endif
  33. extern shalfword dvibyte() ;
  34. extern int add_header() ;
  35. extern void hvpos() ;
  36. extern void figcopyfile() ;
  37. extern void nlcmdout() ;
  38. extern void cmdout() ;
  39. extern void numout() ;
  40. extern void scout() ;
  41. extern void stringend() ;
  42. extern void error() ;
  43. extern void psflush() ;
  44. extern void emspecial() ;
  45. /* IBM: color - begin */
  46. extern void pushcolor() ;
  47. extern void popcolor() ;
  48. extern void resetcolorstack() ;
  49. extern void background() ;
  50. /* IBM: color - end */
  51. extern char errbuf[] ;
  52. extern shalfword linepos;
  53. extern Boolean usesspecial ;
  54. extern Boolean usescolor ;   /* IBM: color */
  55. extern int landscape ;
  56. extern char *paperfmt ;
  57. extern char *nextstring;
  58. extern char *maxstring;
  59. extern char *oname;
  60. extern FILE *bitfile;
  61. extern int quiet;
  62. extern fontdesctype *curfnt ;
  63. extern int actualdpi ;
  64. extern int vactualdpi ;
  65. extern integer hh, vv;
  66. extern int lastfont ;
  67. extern real conv ;
  68. extern real vconv ;
  69. extern integer hpapersize, vpapersize ;
  70. extern Boolean pprescan ;
  71. /* extern char *figpath ;*/
  72. extern int prettycolumn ;
  73. extern Boolean disablecomments ;
  74.  
  75. #ifdef DEBUG
  76. extern integer debug_flag;
  77. #endif
  78. extern void scanfontcomments() ;
  79. extern void handlepapersize() ;
  80.  
  81. static int specialerrors = 20 ;
  82.  
  83. struct bangspecial {
  84.    struct bangspecial *next ;
  85.    char actualstuff[1] ; /* more space will actually be allocated */
  86. } *bangspecials = NULL ;
  87.  
  88. void specerror(s)
  89. char *s ;
  90. {
  91.    if (specialerrors > 0) {
  92.       error(s) ;
  93.       specialerrors-- ;
  94.    } else if (specialerrors == 0) {
  95.       error("more errors in special, being ignored . . .") ;
  96.       specialerrors-- ;
  97.    }
  98. }
  99.  
  100. static void trytobreakout(p)
  101. register char *p ;
  102. {
  103.    register int i ;
  104.    register int instring = 0 ;
  105.    int lastc = 0 ;
  106.  
  107.    i = 0 ;
  108.    (void)putc('\n', bitfile) ;
  109.    while (*p) {
  110.       if (i > 65 && *p == ' ' && instring == 0) {
  111.          (void)putc('\n', bitfile) ;
  112.          i = 0 ;
  113.       } else {
  114.          (void)putc(*p, bitfile) ;
  115.          i++ ;
  116.       }
  117.       if (*p == '(' && lastc != '\\')
  118.          instring = 1 ;
  119.       else if (*p == ')' && lastc != '\\')
  120.          instring = 0 ;
  121.       lastc = *p ;
  122.       p++ ;
  123.    }
  124.    (void)putc('\n', bitfile) ;
  125. }
  126.  
  127. static void dobs(q)
  128. register struct bangspecial *q ;
  129. {
  130.    if (q) {
  131.       dobs(q->next) ;
  132.       trytobreakout(q->actualstuff) ;
  133.    }
  134. }
  135.  
  136. void
  137. outbangspecials() {
  138.    if (bangspecials) {
  139.       cmdout("TeXDict") ;
  140.       cmdout("begin") ;
  141.       cmdout("@defspecial\n") ;
  142.       dobs(bangspecials) ;
  143.       cmdout("\n@fedspecial") ;
  144.       cmdout("end") ;
  145.    }
  146. }
  147.  
  148. /* We recommend that new specials be handled by the following general
  149.  * (and extensible) scheme, in which the user specifies one or more
  150.  * `key=value' pairs separated by spaces.
  151.  * The known keys are given in KeyTab; they take values
  152.  * of one of the following types:
  153.  *
  154.  * None: no value, just a keyword (in which case the = sign is omitted)
  155.  * String: the value should be "<string without double-quotes"
  156.  *                          or '<string without single-quotes'
  157.  * Integer: the value should be a decimal integer (%d format)
  158.  * Number: the value should be a decimal integer or real (%f format)
  159.  * Dimension: like Number, but will be multiplied by the scaledsize
  160.  *       of the current font and converted to default PostScript units
  161.  * (Actually, strings are allowed in all cases; the delimiting quotes
  162.  *  are simply stripped off if present.)
  163.  *
  164.  */
  165.  
  166. typedef enum {None, String, Integer, Number, Dimension} ValTyp;
  167. typedef struct {
  168.    char    *Entry;
  169.    ValTyp  Type;
  170. } KeyDesc;
  171.  
  172. #define NKEYS    (sizeof(KeyTab)/sizeof(KeyTab[0]))
  173.  
  174. KeyDesc KeyTab[] = {{"psfile",  String}, /* j==0 in the routine below */
  175.                     {"ifffile", String}, /* j==1 */
  176.                     {"tekfile", String}, /* j==2 */
  177.                     {"hsize",   Number},
  178.                     {"vsize",   Number},
  179.                     {"hoffset", Number},
  180.                     {"voffset", Number},
  181.                     {"hscale",  Number},
  182.                     {"vscale",  Number},
  183.                     {"angle",   Number},
  184.                     {"llx", Number},
  185.                     {"lly", Number},
  186.                     {"urx", Number},
  187.                     {"ury", Number},
  188.                     {"rwi", Number},
  189.                     {"rhi", Number},
  190.                     {"clip", None}};
  191.  
  192. #ifdef VMS
  193. #ifndef __GNUC__    /* GNUC tolower is too simple */
  194. #define Tolower tolower
  195. #endif
  196. #else
  197. #ifdef VMCMS    /* IBM: VM/CMS */
  198. #define Tolower __tolower
  199. #else
  200. #ifdef MVSXA    /* IBM: MVS/XA */
  201. #define Tolower __tolower
  202. #else
  203. /*
  204.  * compare strings, ignore case
  205.  */
  206. char Tolower(c)
  207. register char c ;
  208. {
  209.    if ('A' <= c && c <= 'Z')
  210.       return(c+32) ;
  211.    else
  212.       return(c) ;
  213. }
  214. #endif
  215. #endif  /* IBM: VM/CMS */
  216. #endif
  217. int IsSame(a, b)
  218. char *a, *b;
  219. {
  220.    for( ; *a != '\0'; ) {
  221.       if( Tolower(*a) != Tolower(*b) ) 
  222.          return( 0 );
  223.       a++ ;
  224.       b++ ;
  225.    }
  226.    return( *b == '\0' );
  227. }
  228.  
  229. char *KeyStr, *ValStr ; /* Key and String values found */
  230. long ValInt ; /* Integer value found */
  231. float ValNum ; /* Number or Dimension value found */
  232.  
  233. char  *GetKeyVal(str,tno) /* returns NULL if none found, else next scan point */
  234.    char *str ; /* starting point for scan */
  235.    int  *tno ; /* table entry number of keyword, or -1 if keyword not found */
  236. {
  237.    register char *s ;
  238.    register int i ;
  239.    register char t ;
  240.  
  241.    for (s=str; *s <= ' ' && *s; s++) ; /* skip over blanks */
  242.    if (*s == '\0')
  243.       return (NULL) ;
  244.    KeyStr = s ;
  245.    while (*s>' ' && *s!='=') s++ ;
  246.    if (0 != (t = *s))
  247.       *s++ = 0 ;
  248.  
  249.    for(i=0; i<NKEYS; i++)
  250.       if( IsSame(KeyStr, KeyTab[i].Entry) )
  251.          goto found ;
  252.    *tno = -1;
  253.    return (s) ;
  254.  
  255. found: *tno = i ;
  256.    if (KeyTab[i].Type == None)
  257.       return (s) ;
  258.  
  259.    if (t && t <= ' ') {
  260.       for (; *s <= ' ' && *s; s++) ; /* now look for the value part */
  261.       if ((t = *s)=='=')
  262.          s++ ;
  263.    }
  264.    ValStr = "" ;
  265.    if ( t == '=' ) {
  266.       while (*s <= ' ' && *s)
  267.          s++ ;
  268.       if (*s=='\'' || *s=='\"')
  269.          t = *s++ ;               /* get string delimiter */
  270.       else t = ' ' ;
  271.       ValStr = s ;
  272.       while (*s!=t && *s)
  273.          s++ ;
  274.       if (*s)
  275.          *s++ = 0 ;
  276.    }
  277.    switch (KeyTab[i].Type) {
  278.  case Integer:
  279.       if(sscanf(ValStr,"%ld",&ValInt)!=1) {
  280.           sprintf(errbuf,"Non-integer value (%s) given for keyword %s",
  281.               ValStr, KeyStr) ;
  282.           specerror(errbuf) ;
  283.           ValInt = 0 ;
  284.       }
  285.       break ;
  286.  case Number:
  287.  case Dimension:
  288.       if(sscanf(ValStr,"%f",&ValNum)!=1) {  
  289.           sprintf(errbuf,"Non-numeric value (%s) given for keyword %s",
  290.               ValStr, KeyStr) ;
  291.           specerror(errbuf) ;
  292.           ValNum = 0.0 ;
  293.       }
  294.       if (KeyTab[i].Type==Dimension) {
  295.          if (curfnt==NULL)
  296.             error("! No font selected") ;
  297.          ValNum = ValNum * ((double)curfnt->scaledsize) * conv * 72 / DPI ;
  298.       }
  299.       break ;
  300.  default: break ;
  301.    }
  302.    return (s) ;
  303. }
  304.  
  305. /*
  306.  *   Now our routines.  We get the number of bytes specified and place them
  307.  *   into the string buffer, and then parse it. Numerous conventions are
  308.  *   supported here for historical reasons.
  309.  */
  310.  
  311. void predospecial(numbytes, scanning)
  312. integer numbytes ;
  313. Boolean scanning ;
  314. {
  315.    register char *p = nextstring ;
  316.    register int i = 0 ;
  317.    int j ;
  318.  
  319.    if (nextstring + numbytes > maxstring)
  320.       error("! out of string space in predospecial") ;
  321.    for (i=numbytes; i>0; i--)
  322. #ifdef VMCMS /* IBM: VM/CMS */
  323.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  324. #else
  325. #ifdef MVSXA /* IBM: MVS/XA */
  326.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  327. #else
  328.       *p++ = (char)dvibyte() ;
  329. #endif /* IBM: VM/CMS */
  330. #endif
  331.    if (pprescan)
  332.       return ;
  333.    while (p[-1] <= ' ' && p > nextstring)
  334.       p-- ; /* trim trailing blanks */
  335.    if (p==nextstring) return ; /* all blank is no-op */
  336.    *p = 0 ;
  337.    p = nextstring ;
  338.    while (*p <= ' ')
  339.       p++ ;
  340. #ifdef DEBUG
  341.    if (dd(D_SPECIAL))
  342.       (void)fprintf(stderr, "Preprocessing special: %s\n", p) ;
  343. #endif
  344.  
  345. /*
  346.  *   We use strncmp() here to also pass things like landscape()
  347.  *   or landscape: or such.
  348.  */
  349.  
  350.    if (strncmp(p, "landscape", 9)==0) {
  351.       if (hpapersize || vpapersize)
  352.          error(
  353.              "both landscape and papersize specified:  ignoring landscape") ;
  354.       else
  355.          landscape = 1 ;
  356.       return ;
  357.    } else if (strncmp(p, "papersize", 9)==0) {
  358.       p += 9 ;
  359.       while (*p == '=' || *p == ' ')
  360.          p++ ;
  361.       if (hpapersize == 0 || vpapersize == 0) {
  362.          if (landscape) {
  363.             error(
  364.              "both landscape and papersize specified:  ignoring landscape") ;
  365.             landscape = 0 ;
  366.          }
  367.          handlepapersize(p, &hpapersize, &vpapersize) ;
  368.       }
  369.       return ;
  370.    }
  371.    if (strncmp(p, "xtex:", 5)==0) return ;
  372.    usesspecial = 1 ;  /* now the special prolog will be sent */
  373.    if (strncmp(p, "header", 6)==0) {
  374.       char *q ;
  375.       p += 6 ;
  376.       while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0)
  377.          p++ ;
  378.       q = p ;  /* we will remove enclosing parentheses */
  379.       p = p + strlen(p) - 1 ;
  380.       while ((*p <= ' ' || *p == ')') && p >= q)
  381.          p-- ;
  382.       p[1] = 0 ;
  383.       if (p >= q)
  384.          (void)add_header(q) ;
  385.    }
  386. /* IBM: color - added section here for color header and color history */
  387.    if (strncmp(p, "background", 10) == 0) {
  388.       usescolor = 1 ;
  389.       p +=11 ;
  390.       while ( *p <= ' ' ) p++ ;
  391.       background(p) ;
  392.    }
  393.    if (strncmp(p, "color", 5) == 0) {
  394.       usescolor = 1 ;
  395.       p += 6 ;
  396.       while ( *p <= ' ' ) p++ ;
  397.       if (strncmp(p, "push", 4) == 0 ) {
  398.          p += 5 ;
  399.          while ( *p <= ' ' ) p++ ;
  400.          pushcolor(p, 0) ;
  401.       } else if (strncmp(p, "pop", 3) == 0 ) {
  402.          popcolor(0) ;
  403.       } else {
  404.          resetcolorstack(p,0) ;
  405.       }
  406.    }   /* IBM: color - end changes */
  407.    else if (*p == '!') {
  408.       register struct bangspecial *q ;
  409.       p++ ;
  410.       q = (struct bangspecial *)mymalloc((integer)
  411.                          (sizeof(struct bangspecial) + strlen(p))) ;
  412.       (void)strcpy(q->actualstuff, p) ;
  413.       q->next = bangspecials ;
  414.       bangspecials = q ;
  415.    } else if (scanning && *p != '"' &&
  416.           (p=GetKeyVal(p, &j)) != NULL && j==0)
  417.       scanfontcomments(ValStr) ;
  418. }
  419.  
  420. int maccess(s)
  421. char *s ;
  422. {
  423.    FILE *f = search(figpath, s, "r") ;
  424.    if (f)
  425.       fclose(f) ;
  426.    return (f != 0) ;
  427. }
  428.  
  429. char *tasks[] = { 0, "iff2ps", "tek2ps" } ;
  430.  
  431. static char psfile[511] ; 
  432. void dospecial(numbytes)
  433. integer numbytes ;
  434. {
  435.    register char *p = nextstring ;
  436.    register int i = 0 ;
  437.    int j, systemtype = 0 ;
  438.    register char *q ;
  439.    Boolean psfilewanted = 1 ;
  440.    char *task = 0 ;
  441.    char cmdbuf[111] ; 
  442.  
  443.    if (nextstring + i > maxstring)
  444.       error("! out of string space in dospecial") ;
  445.    for (i=numbytes; i>0; i--)
  446. #ifdef VMCMS /* IBM: VM/CMS */
  447.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  448. #else
  449. #ifdef MVSXA /* IBM: MVS/XA */
  450.       *p++ = ascii2ebcdic[(char)dvibyte()] ;
  451. #else
  452.       *p++ = (char)dvibyte() ;
  453. #endif  /* IBM: VM/CMS */
  454. #endif
  455.    while (p[-1] <= ' ' && p > nextstring)
  456.       p-- ; /* trim trailing blanks */
  457.    if (p==nextstring) return ; /* all blank is no-op */
  458.    *p = 0 ;
  459.    p = nextstring ;
  460.    while (*p <= ' ')
  461.       p++ ;
  462. #ifdef DEBUG
  463.    if (dd(D_SPECIAL))
  464.       (void)fprintf(stderr, "Processing special: %s\n", p) ;
  465. #endif
  466.  
  467.    if (strncmp(p, "em:", 3)==0) {    /* emTeX specials in emspecial.c */
  468.     emspecial(p);
  469.     return;
  470.    }
  471.  
  472.    if (strncmp(p, "ps:", 3)==0) {
  473.         psflush() ; /* now anything can happen. */
  474.         if (p[3]==':') {
  475.            if (strncmp(p+4, "[begin]", 7) == 0) {
  476.               hvpos() ;
  477.               trytobreakout(&p[11]);
  478.            } else if (strncmp(p+4, "[end]", 5) == 0)
  479.               trytobreakout(&p[9]);
  480.            else trytobreakout(&p[4]);
  481.         } else if (strncmp(p+3, " plotfile ", 10) == 0) {
  482.              char *sfp ;
  483.              hvpos() ;
  484.              p += 13;
  485.            /*
  486.             *  Fixed to allow popen input for plotfile
  487.             *  TJD 10/20/91
  488.             */
  489.            while (*p == ' ') p++;
  490.            if (*p == '"') {
  491.              p++;
  492.              for (sfp = p; *sfp && *sfp != '"'; sfp++) ;
  493.            } else {
  494.              for (sfp = p; *sfp && *sfp != ' '; sfp++) ;
  495.            }
  496.            *sfp = '\0';
  497.            if (*p == '`') 
  498.              figcopyfile(p+1, 1);
  499.            else
  500.              figcopyfile (p, 0);
  501.            /* End TJD changes */
  502.         } else {
  503.            hvpos() ;
  504.            trytobreakout(&p[3]);
  505.            psflush() ;
  506.            hvpos() ;
  507.         }
  508.         return;
  509.    }
  510.    if (strncmp(p, "landscape", 9)==0 || strncmp(p, "header", 6)==0 ||
  511.        strncmp(p, "papersize", 9)==0 || *p=='!')
  512.       return ; /* already handled in prescan */
  513. /* IBM: color - begin changes */
  514.    if ( strncmp(p, "background", 10) == 0 )
  515.       return ; /* already handled in prescan */
  516.    if (strncmp(p, "color", 5) == 0) {
  517.       p += 6 ;
  518.       while ( *p <= ' ' ) p++ ;
  519.       if (strncmp(p, "push", 4) == 0 ) {
  520.          p += 4 ;
  521.          while ( *p <= ' ' ) p++ ;
  522.          pushcolor(p,1);
  523.       } else if (strncmp(p, "pop", 3) == 0 ) {
  524.          popcolor(1) ;
  525.       } else {
  526.          resetcolorstack(p,1) ;
  527.       }
  528.       return ;
  529.    } /* IBM: color - end changes*/
  530. #ifdef TPIC
  531. /* ordered as in tpic 2.0 documentation for ease of cross-referencing */
  532.    if (strncmp(p, "pn ", 3) == 0) {setPenSize(p+2); return;}
  533.    if (strncmp(p, "pa ", 3) == 0) {addPath(p+2); return;}
  534.    if (strcmp(p, "fp") == 0) {flushPath(0); return;}
  535.    if (strcmp(p, "ip") == 0) {flushPath(1); return;} /* tpic 2.0 */
  536.    if (strncmp(p, "da ", 3) == 0) {flushDashed(p+2, 0); return;}
  537.    if (strncmp(p, "dt ", 3) == 0) {flushDashed(p+2, 1); return;}
  538.    if (strcmp(p, "sp") == 0) {flushSpline(p+2); return;} /* tpic 2.0 */
  539.    if (strncmp(p, "sp ", 3) == 0) {flushSpline(p+3); return;} /* tpic 2.0 */
  540.    if (strncmp(p, "ar ", 3) == 0) {arc(p+2, 0); return;} /* tpic 2.0 */
  541.    if (strncmp(p, "ia ", 3) == 0) {arc(p+2, 1); return;} /* tpic 2.0 */
  542.    if (strcmp(p, "sh") == 0) {shadeLast(p+2); return;} /* tpic 2.0 */
  543.    if (strncmp(p, "sh ", 3) == 0) {shadeLast(p+3); return;} /* tpic 2.0 */
  544.    if (strcmp(p, "wh") == 0) {whitenLast(); return;}
  545.    if (strcmp(p, "bk") == 0) {blackenLast(); return;}
  546.    if (strncmp(p, "tx ", 3) == 0) {SetShade(p+3); return;}
  547. #endif
  548.    if (*p == '"') {
  549.       hvpos() ;
  550.       cmdout("@beginspecial") ;
  551.       cmdout("@setspecial") ;
  552.       trytobreakout(p+1) ;
  553.       cmdout("\n@endspecial") ;
  554.       return ;
  555.    }
  556.  
  557. /* At last we get to the key/value conventions */
  558.    psfile[0] = '\0';
  559.    hvpos();
  560.    cmdout("@beginspecial");
  561.  
  562.    while( (p=GetKeyVal(p,&j)) != NULL )
  563.       switch (j) {
  564.  case -1: /* for compatability with old conventions, we allow a file name
  565.            * to be given without the 'psfile=' keyword */
  566.          if (!psfile[0] && maccess(KeyStr)==0) /* yes we can read it */
  567.              (void)strcpy(psfile,KeyStr) ;
  568.          else {
  569.            sprintf(errbuf, "Unknown keyword (%s) in \\special will be ignored",
  570.                               KeyStr) ;
  571.            specerror(errbuf) ;
  572.          }
  573.          break ;
  574.  case 0: case 1: case 2: /* psfile */
  575.          if (psfile[0]) {
  576.            sprintf(errbuf, "More than one \\special %s given; %s ignored", 
  577.                     "psfile",  ValStr) ;
  578.            specerror(errbuf) ;
  579.          }
  580.          else (void)strcpy(psfile,ValStr) ;
  581.          task = tasks[j] ;
  582.          break ;
  583.  default: /* most keywords are output as PostScript procedure calls */
  584.          if (KeyTab[j].Type == Integer)
  585.             numout((integer)ValInt);
  586.          else if (KeyTab[j].Type == String)
  587.             for (q=ValStr; *q; q++)
  588.                scout(*q) ;
  589.          else if (KeyTab[j].Type == None) ;
  590.          else { /* Number or Dimension */
  591.             ValInt = (integer)(ValNum<0? ValNum-0.5 : ValNum+0.5) ;
  592.             if (ValInt-ValNum < 0.001 && ValInt-ValNum > -0.001)
  593.                 numout((integer)ValInt) ;
  594.             else {
  595.                (void)sprintf(cmdbuf, "%f", ValNum) ;
  596.                cmdout(cmdbuf) ;
  597.             }
  598.          }
  599.       (void)sprintf(cmdbuf, "@%s", KeyStr);
  600.       cmdout(cmdbuf) ;
  601.       }
  602.  
  603.    cmdout("@setspecial");
  604.  
  605.    if(psfile[0]) {
  606.       if (task == 0) {
  607.          systemtype = (psfile[0]=='`') ;
  608.          figcopyfile(psfile+systemtype, systemtype);
  609.       } else {
  610.          fil2ps(task, psfile) ;
  611.       }
  612.    } else if (psfilewanted)
  613.       specerror("No \\special psfile was given; figure will be blank") ;
  614.  
  615.    cmdout("@endspecial");
  616. }
  617.  
  618. extern char realnameoffile[] ;
  619. /* extern char *pictpath ; */
  620.  
  621. void fil2ps(task, iname)
  622. char *task, *iname ;
  623. {
  624.    char cmd[400] ;
  625.    FILE *f ;
  626.    if (0 != (f=search(pictpath, iname, "r"))) {
  627.       fclose(f) ;
  628.    } else {
  629.       fprintf(stderr, " couldn't open %s\n", iname) ;
  630.       return ;
  631.    }
  632.    if (!quiet) {
  633.       fprintf(stderr, " [%s", realnameoffile) ;
  634.       fflush(stderr) ;
  635.    }
  636.    if (oname && oname[0] && oname[0] != '-') {
  637.       putc(10, bitfile) ;
  638.       fclose(bitfile) ;
  639.       sprintf(cmd, "%s -f %s %s", task, realnameoffile, oname) ;
  640.       system(cmd) ;
  641.       if ((bitfile=fopen(oname, "a"))==NULL)
  642.          error("! couldn't reopen PostScript file") ;
  643.       linepos = 0 ;
  644.    } else {
  645.       sprintf(cmd, "%s -f %s", task, realnameoffile) ;
  646.       system(cmd) ;
  647.    }
  648.    if (!quiet)
  649.       fprintf(stderr, "]") ;
  650. }
  651.  
  652.